home *** CD-ROM | disk | FTP | other *** search
- Path: inforamp.net!ts6-06
- From: rmorin@inforamp.net (Randy Charles Morin)
- Newsgroups: comp.lang.c++
- Subject: Re: How to append data in visual c++
- Date: Sat, 09 Mar 96 19:55:44 GMT
- Organization: MiddleWorld SoftWare
- Message-ID: <4hsnod$rsm@sam.inforamp.net>
- References: <4hk4g6$afg@ustsu10.ust.hk>
- NNTP-Posting-Host: ts6-06.tor.inforamp.net
- X-Newsreader: News Xpress Version 1.0 Beta #4
-
- In article <4hk4g6$afg@ustsu10.ust.hk>,
- ee_twh@uxmail.ust.hk (Tsang Wai Hung) wrote:
- > I am now doing videoconferencing. When I receive a pointer through
- >network which contain binary data, I want to append it to another pointer.
- >These two pointers belong to LPSTR. How can I append it? Is there
- >any function like strcat and strcpy but for binary data?
-
- I'm not sure what you mean, but if you mean that you have two LPSTR's and want
- to concatenate them, then the first solution applies. If you have two LPSTR's
- and know for certain they are binary and are aware of the length, then the
- second solution applies. If LPSTR is not the same as the windows type, then
- please completely ignore my suggestions.
-
- #1
- Try the following...
-
- LPSTR a,b;
- lstrcat(a,b);
-
- ..this appends b to the end of a.
- lstrcat is part of the standard windows API.
-
- #2
- Try the following...
-
- LPSTR a,b;
- int aLength, bLength;
- memcpy(a+aLength,b,bLength);
- aLength+=bLength;
-
- ..this appends b to the end of a.
- memcpy is part of the standard library.
-
-